package com.bos.sms;

import com.bos.utils.SendMessageUtil;
import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
import java.io.UnsupportedEncodingException;

/**
 * @author misterWei
 * @create 2018年11月19号:11点04分
 * @mailbox mynameisweiyan@gmail.com
 */
@Component("ququeCustomer")
public class QuqueCustomer implements MessageListener {
    @Override
    public void onMessage(Message message) {
        MapMessage mapMessage = (MapMessage) message;
        //监听
        try {
            System.out.println("sendMessage:"+mapMessage.getString("telephone")+"---"+ mapMessage.getString("content"));
            SendMessageUtil.sendSmsByHTTP(mapMessage.getString("telephone"), mapMessage.getString("content"));
        } catch (Exception e) {

        }
    }
}
